From: Florian Müllner Date: Fri, 13 Jul 2018 17:16:14 +0000 (+0200) Subject: windowAttentionHandler: Handle XUrgencyHint as well X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2~1^2~40 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=284978757ee6b13dc9678700e2b1972507dbaaa5;p=gnome-shell.git windowAttentionHandler: Handle XUrgencyHint as well While it's not commonly used, it is easy enough to handle it the same as the demands-attention hint, so do just that. https://bugzilla.gnome.org/show_bug.cgi?id=643595 --- diff --git a/js/ui/windowAttentionHandler.js b/js/ui/windowAttentionHandler.js index 524e47c0f..a8c688ef3 100644 --- a/js/ui/windowAttentionHandler.js +++ b/js/ui/windowAttentionHandler.js @@ -13,6 +13,8 @@ var WindowAttentionHandler = new Lang.Class({ this._tracker = Shell.WindowTracker.get_default(); this._windowDemandsAttentionId = global.display.connect('window-demands-attention', this._onWindowDemandsAttention.bind(this)); + this._windowMarkedUrgentId = global.display.connect('window-marked-urgent', + this._onWindowDemandsAttention.bind(this)); }, _getTitleAndBanner(app, window) { @@ -66,7 +68,9 @@ var Source = new Lang.Class({ this.signalIDs = []; this.signalIDs.push(this._window.connect('notify::demands-attention', - () => { this.destroy(); })); + this._sync.bind(this)); + this.signalIDs.push(this._window.connect('notify::urgent', + this._sync.bind(this)); this.signalIDs.push(this._window.connect('focus', () => { this.destroy(); })); this.signalIDs.push(this._window.connect('unmanaged', @@ -75,6 +79,12 @@ var Source = new Lang.Class({ this.connect('destroy', this._onDestroy.bind(this)); }, + _sync() { + if (this._window.demands_attention || this._window.urgent) + return; + this.destroy(); + }, + _onDestroy() { for(let i = 0; i < this.signalIDs.length; i++) { this._window.disconnect(this.signalIDs[i]);